package chamster.view;

import java.awt.Point;
/**
 * Represents the sight of a field
 * @author mark
 *
 */
public abstract class Sight {
	
	private final Point locationInView;
	
	public Sight(Point locationInView) {
		this.locationInView = locationInView;
	}
	
	public Point getLocationInView() {
		return this.locationInView;
	}
	
	public abstract boolean canMoveTo();

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((locationInView == null) ? 0 : locationInView.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Sight other = (Sight) obj;
		if (locationInView == null) {
			if (other.locationInView != null)
				return false;
		} else if (!locationInView.equals(other.locationInView))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Sight [locationInView=" + locationInView + "]";
	}
}
